<?php
$path = array(
    'person.form-title' => 'admin/person/all',
    format::personFullName($person) => 'admin/person/display?id=' . $person['id'],
);
$desc = NULL;
if (sql::isPersistent($formData)) {
    $path['person.accountEdit-title'] = '';
}
else {
    $path['person.accountCreate-title'] = '';
    $desc = 'person.accountCreate-desc';
}

html::printPath($path, $desc);
$msg->printMessages();

$fb = new FormBuilder('person', $formData);
$fb->setAction('/admin/person/accountSave');
$fb->hidden('person_id');
$fb->text('login')->required();
if (! sql::isPersistent($formData)) {
    $fb->password('password')->required();
}
$fb->yesNoBox('is_admin')->noEmptyOption();
$fb->yesNoBox('is_blocked')->hint()->noEmptyOption();
$fb->submitButton();
$fb->write();